<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;padding: 0
        }
        ul,li{
           list-style:none;
        }
        ul{
            width: 500px;
            height: 30px;
            background-color: #ccc;
        }
        li{
            float: left;
            width: 100px;
            height: 30px;
            line-height: 30px;
            text-align: center
        }
        li:hover{
            background-color: black;
            color: #fff;
        }
    </style>
</head>
<body>
    <ul>
        <li>首页1</li>
        <li>首页2</li>
        <li>首页3</li>
        <li>首页4</li>
        <li>首页5</li>
    </ul>
</body>
</html>